<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <script src="js/vue-2.6.10.js"></script>
    <style type="text/css">
        div {
            width: 100px;
            height: 100px;
            color: white;
        }
        .red{
            background-color: red;
        }
        .blue{
            background-color: blue;
        }
    </style>
</head>
<body>
<div id="app">
   <button @click="color='red'">点我变红色</button>
    <button @click="color='blue'">点我变蓝色</button>
    <!--v-bind-->
    <div  v-bind:class="color">
    </div>


    <button @click="bool=!bool">点我改变下面色块的颜色</button>

    <div :class="{red:bool,blue:!bool}">
    </div>

</div>
<script type="text/javascript">
  var app=new Vue({
            el:"#app",
            data:{
                color:'red',
                bool:true

            },

          })
</script>

</body>
</html>